# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Bence Balint <balintbence1337@gmail.com>

pkgname=python-w3lib
pkgver=2.1.1
pkgrel=2
pkgdesc="Library of web-related functions"
arch=('any')
license=('BSD')
url="https://github.com/scrapy/w3lib"
depends=('python')
makedepends=('python-setuptools')
checkdepends=('python-pytest')
source=("$pkgname-$pkgver.tar.gz::https://github.com/scrapy/w3lib/archive/v$pkgver.tar.gz")
sha512sums=('897a2ead229c1cfdba83c78383169bb731840a024e1304e47482e24b38687f49d57474ec02bbbb6282f348ae4bff5398f3e8da923aed29bde52a2ac400f100b0')

build() {
  cd w3lib-$pkgver
  python setup.py build
}

check() {
  cd w3lib-$pkgver
  pytest
}

package() {
  cd w3lib-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
